package com.matt.foundation.vo;

import com.matt.domain.NoticeMessage;
import com.matt.foundation.constant.NoticeMessageConstant;
import lombok.Data;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/3/23
 * *******************************
 */
@Data
public class NoticeMessageVo {
    private Integer category;
    private String message;
    private String linkId;
    private String url;
    private String ext;
    private String description;

    public static NoticeMessageVo of(NoticeMessage message, String url){
        NoticeMessageVo vo = new NoticeMessageVo();
        vo.setMessage(message.getMessage());
        vo.setCategory(message.getCategory());
        vo.setLinkId(message.getLinkId());
        vo.setUrl(url);
        vo.setDescription(NoticeMessageConstant.Category.NURSERY_AUDITOR.get(message.getCategory()).descriptionOf());
        vo.setExt(message.getExt());
        return vo;
    }
}
